﻿using System;

namespace ExFlash.Tags
{
    public class ScriptLimitsTag : Tag
    {
        private const int ScriptLimitTagSize = 4;

        public ushort MaxRecursionDepth
        {
            get;
            private set;
        }

        public ushort ScriptTimeoutSeconds
        {
            get;
            private set;
        }

        public ScriptLimitsTag(Int32 offset)
            : base(TagCodes.ScriptLimits, ScriptLimitTagSize, offset)
        {

        }

        public override void SwfDeserialize(BinaryBitReader reader)
        {
            MaxRecursionDepth = reader.ReadUInt16();

            ScriptTimeoutSeconds = reader.ReadUInt16();
        }

        public override void SwfSerialize(byte[] arr, ref int offset)
        {
            throw new NotImplementedException();
        }
    }
}
